package com.pickgliss.ui.core
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;

	public class UISpriteLayer extends SpriteLayer
	{
		private var _upContainer		:SpriteLayer;
		private var _rightContainer	:SpriteLayer;
		private var _downContainer		:SpriteLayer;
		private var _leftContainer		:SpriteLayer;
		
		public static const UP_CONTAINER			:int = 0;
		public static const RIGHT_CONTAINER		:int = 1;
		public static const DOWN_CONTAINER		:int = 2;
		public static const LEFT_CONTAINER		:int = 3;
		
		public function UISpriteLayer()
		{
			super();
			_upContainer			= new SpriteLayer();
			_rightContainer		= new SpriteLayer();
			_downContainer	= new SpriteLayer();
			_leftContainer		= new SpriteLayer();
			mouseEnabled = false;
			addChild(_upContainer);
			addChild(_downContainer);
			addChild(_rightContainer);
			addChild(_leftContainer);
		}
		override protected function addToContainer(child:DisplayObject,container:int = 0):void
		{
			switch(container)
			{
				case UP_CONTAINER:
					_upContainer.addChild(child);
					break;
				case RIGHT_CONTAINER:
					_rightContainer.addChild(child);
					break;
				case DOWN_CONTAINER:
					_downContainer.addChild(child);
					break;
				case LEFT_CONTAINER:
					_leftContainer.addChild(child);
					break;
			}
		}
		public function getContainerByType(type:int):Sprite
		{
			switch(type)
			{
				case UP_CONTAINER:
					return _upContainer;
					break;
				case RIGHT_CONTAINER:
					return _rightContainer;
					break;
				case DOWN_CONTAINER:
					return _downContainer;
					break;
				case LEFT_CONTAINER:
					return _leftContainer;
					break;
			}
			return null;
		}
	}
}